import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# 创建数据点
x1 = np.linspace(-10, 10, 100)
x2 = np.linspace(-10, 10, 100)
x1, x2 = np.meshgrid(x1, x2)
y = 0.1 * x1 + 0.3 * x2

# 创建图形和三维轴
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# 绘制平面
ax.plot_surface(x1, x2, y, cmap='viridis')

# 添加标签
ax.set_xlabel('x1')
ax.set_ylabel('x2')
ax.set_zlabel('y')
ax.set_title('Plane defined by y = 0.1*x1 + 0.3*x2')

# 显示图形
plt.show()